-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX(client): Fix using the keyboad to change local volume adjustment #6238
FIX(client): Fix using the keyboad to change local volume adjustment #6238
Conversation
608226f
to
2ee6135
Compare
Ahhrg, the problem still exists when scrolling over a focused slider with the mouse... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing to keep in mind here is that for volume changes for listeners, every change will trigger a message to be sent to the server (with newer versions of Mumble) as the listener volumes are (partially) handled server-side.
Therefore, I think we'll want some kind of delay before triggering changeCompleted
to see whether the user is currently simply smashing the arrows keys to get the slider to the position that they want and only once they have settled on a given value (for e.g. half a second) do we actually trigger the event.
4c5968a
to
5d32ac3
Compare
76e1b95
to
e8e0f1b
Compare
I do not get this to work in a nice user friendly way. It either feels laggy, or does not update the user state correctly. I tried to implement bursts, but it does not help. Any advice? |
e8e0f1b
to
12b0832
Compare
After more testing I figured out, why this feels currently laggy. For some reason - investigation pending - the server does not acknowledge every change of the listener volume adjustment. This can only be reasonably noticed with a client that prints the decibel value next to the user, as you can see the number is not being updated properly. I have added a screenshot which shows the problem: The client sends the new adjustment, but there is no ack (or rather listener update) coming from the server. Is the server rejecting fast client changes anyway? That would make it really hard for us to implement proper burst behavior without knowing the server configuration... This should also be a problem in current versions of Mumble, if you slide the slider fast enough with the mouse. |
1c83d7d
to
3e769ab
Compare
Ok here is my new take on the timer: I am running into the server message burst limit in my testing whether I use a timer or not. The Mumble server already restricts the control messages it accepts from a client. It should not be the burden of any individual feature of the Mumble client to restrict the message count sent to the server, except for trivial cases. Therefore I propose we
|
272d635
to
94be80c
Compare
This in and of itself would not really solve the problem though. It would prevent the client from running into the rate limiter, but it could also lead to situations where all kinds of actions appear super, super laggy just because the user has spammed the arrow key in the volume adjustment dialog (or something similar). I would rather opt for the laggy behavior when using arrow keys 👀 What was the timer delay that you have used before sending out a message to the server about the new listener volume? By default the server accepts 1 control message per second in the long run and 5 messages per second for short bursts. In order to make the lag less apparent, we could use something like a capped exponential growth for determining the current delay: E.g. the first time the arrow key is pressed, we send a message immediately. The second time, we wait for something like 250ms and if we register a third key press, we push the timeout to 1s. The timeout before updating the actual adjustment could also be indicated in the UI so that the user gets informed about it. Alternatively, we could simply always set the timeout between key presses to e.g. 750ms, which should make sure that unless a user is deliberately trying to hit the rate limit, they won't run into it. This would make all volume updates via key presses somewhat laggy, but I think that would be a reasonable compromise between effort of implementation and UX. Maybe the timeout could even be lowered a bit further. This would need some testing. We only have to make sure that if the last UI change has not (yet) led to an update sent to the server, we send that update upon closing the dialog. This should ensure that the adjustments are always communicated to the server, regardless of how quickly the user closes the dialog again. |
6ea4507
to
fba668c
Compare
Alright, so first I implemented a new timer in the ListenerVolumeSlider similar to what you suggested. It works now, it is not an excellent UX, but it works. It also updates the volume after you close the QMenu. But - let me tell you - I have spent countless hours implementing a mouse wheel event observer. And I have just now realized, that it was buggy Qt all along that threw me off. Guess what? Qt mouse wheel behavior is entirely non-deterministic. When you start up the app you have the chance to be in one of 3 or so states which each will produce completely different \rant Anyway, I hope this MR now covers all the problems with the slider updates. If there is nothing more to be done here, feel free to merge. This is ready as far as I am concerned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nitpicks. Once they are fixed, feel free to merge this yourself
void ListenerVolumeSlider::sendToServer() { | ||
ServerHandlerPtr handler = Global::get().sh; | ||
|
||
m_resetTimer.start(3000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 2s would probably also be sufficient. But I'm also fine with leaving this at 3s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mh, I have excessively tested all the timings for 3s now. And I really do not feel like going over that all over again with 2s :/
It speaks for you that you endured this silliness with scroll events. My approach would have been to say "well, no scroll support here" 🤷 |
62cb227
to
208d83c
Compare
Previously, when using keyboard arrows or the mouse wheel, the new slider widget action applied the new local volume but did not save it. That was because it used the sliderReleased event to save the value, which is not triggered by keyboard or mouse wheel updates. We could simply save the local volume on every sliderChange instead of on sliderRelease, but that would cause many writes to the disk in a short period of time and possibly lag the client. Additionally, the ListenerVolumeSlider would spam packets to the server, as the listener volume is saved server-side. This commit introduces event filters in addition to the sliderChanged event, which are observing key releases and mouse wheel events. It also introduces a delay timer for packets send to the server from the ListenerVolumeSlider. Fixes mumble-voip#6211
208d83c
to
6213ed4
Compare
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
Previously, when using keyboard arrows, the new slider widget action applied the new local volume but did not save it. That was because it used the sliderReleased event to save the value, which is not triggered by keyboard updates.
We could simply save the local volume on every sliderChange instead of on sliderRelease, but that would cause many writes to the disk in a short period of time and possibly lag the client.
This commit introduces an event filter in addition to the sliderChanged event, which is observing key releases. If the slider has focus and left/right is released, it is then calling the save slot of the slider.
Fixes #6211